home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 1.5 KB | 66 lines | [TEXT/CWIE] |
- // HFSIterator.h
- // Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
- // a tool for efficiently implementing IADocIterator on HFS file systems
-
- #pragma once
- #ifndef HFSIterator_h
- #define HFSIterator_h
-
- #pragma import on
-
- #include "IACommon.h"
-
- //#pragma IA_BEGIN_IMPORTS
- #include <Files.h>
- //#pragma IA_END_IMPORTS
-
- #pragma IA_BEGIN_EXPORTS
-
- struct DirectoryInfo {
- long id; // the id
- short length; // the number of files
- private:
- void* operator new(size_t size); // stack or array allocate only
- };
-
-
- class HFSIterator : public IAObject {
- public:
- HFSIterator(short vRefNum, long rootDirId = 2);
- ~HFSIterator();
- bool Increment();
-
- CInfoPBRec* GetPBRec() const {return pb;}
-
- // Accessors needed to override Increment()
- DirectoryInfo* GetDirInfos() const {return dirInfos;}
- long GetDirCount() const {return dirCount;}
-
- uint32 GetDir() const {return dir;}
- void SetDir(uint32 newValue) {dir = newValue;}
-
- short GetDirIndex() const {return dirIndex;}
- void SetDirIndex(short newValue) {dirIndex = newValue;}
-
- protected:
-
- void CollectDirInfo();
-
- private:
- void CollectDirInfoInternal(uint32* dirInfosLen);
-
- CInfoPBRec* pb; // info about current file
- DirectoryInfo* dirInfos; // sorted array of directory ids for current volume
- long dirCount; // length of dirInfos
- uint32 dir; // index in dirInfos of directory being processed
- short dirIndex; // index into directory being processed
-
- };
-
- #pragma IA_END_EXPORTS
-
- #pragma import reset
-
- #endif
-